<?php 
	global $class,$method;
?>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $pageTitle;?></title>
<link rel="stylesheet" media="screen" href="/css/common.css" />
<?php if (isset($pageCss)): foreach( $pageCss  as $file):?>
<link href="<?=base_url("css/{$file}.css")?>" media="screen" rel="stylesheet" type="text/css" />
<?php endforeach; endif;?>
<script type="text/javascript">
	var $user = $user || {};
	
	<?php if(isset($_user)){
		foreach($_user as $k => $v){
			echo '$user.' . $k . '=' . $v. ';';
		}
	}
?>
</script>
</head>
<body>
<div class="top-t">
	<div class="header">
    	 <a href="<?php echo base_url();?>">
            <img src="/images/logo.png" id="logo" />
         </a>
         <ul class="t-menu">
         <?php 
         	foreach ($modules as $k=>$m):
         		if($m['parent_id'] == 0 && $m['status'] && !$m['is_admin']):
         ?>
	         <li class="menu-item <?php if ($m['mod_code']==$class):echo ' current-menu-item';endif;?>">
	         	<a href="<?php echo site_url($m['mod_url']);?>"><?php echo $m['mod_name']?></a>
	         </li>
	     <?php endif; endforeach;?>
	     </ul>
         <div class="header-user">
         <?php if (empty($_user)):?>
         	<a href="<?php echo site_url('user/login');?>">登录</a>
         	<a href="<?php echo site_url('user/register');?>">注册</a>
         <?php else:?>
         	<a href="#"><?php echo $_user['username'];?></a>
         	<a href="<?php echo site_url('user/logout');?>">退出</a>
         <?php endif;?>
         </div>
         <div class="search">
		     <form action="/search">
	         	<input type="text" value="" placeholder="搜索" name="q" />
	         </form>
         </div>
     </div>
</div>